package com.chj.consumers;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class RabbitMQConsumer {

    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(value = "onstar.service.queue.${spring.application.name}.test", durable = "true"),
            exchange = @Exchange(value = "chj.service.topic.producer-service", durable = "true", type = ExchangeTypes.TOPIC),
            key = "send.test"
        )
    )
    public void payMessageListener(String message) throws Exception {
        log.info("---------> {}", message);
    }

}
